<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Using CruiseControl.NET with MSTest</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Using CruiseControl.NET with MSTest
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Jan 25, 2007 by <font color="#0050B2">orogers</font>.
				    </div>

				    <h3><a name="UsingCruiseControl.NETwithMSTest-IntegratingMSTestintoyourbuild"></a>Integrating MSTest into your build</h3>

<p>You can use MSTest.exe to execute your MSTest unit tests from the command-line.  You can find a list of the MSTest.exe command-line options <a href="http://msdn2.microsoft.com/en-us/library/ms182489">here</a>.  You will need to using the <b>/resultsfile:</b> command-line option in order to get MSTest to log the test results to file so that they can be included in the build report.</p>

<p>MSTest.exe can be invoked either from your MSBuild script, your NAnt script or directly from CruiseControl.NET by using an <a href="Executable Task.html" title="Executable Task">&lt;exec&gt; task</a>.</p>

<h3><a name="UsingCruiseControl.NETwithMSTest-IntegratingMSTestresultsintotheBuildReport"></a>Integrating MSTest results into the Build Report</h3>

<p>In order to get the MSTest results to show up in the WebDashboard build report, you will need to merge the xml output file generated by MSTest into the build log.  You can do this using the Merge File Task.  Lastly, you will need to modify your <b>dashboard.config</b> file in order to include a reference to the <b>MsTestSummary.xsl</b> stylesheet like this:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;buildReportBuildPlugin&gt;</span>
	<span class="code-tag">&lt;xslFileNames&gt;</span>
		...
		<span class="code-tag">&lt;xslFile&gt;</span>xsl\MsTestSummary.xsl<span class="code-tag">&lt;/xslFile&gt;</span>
		...
	<span class="code-tag">&lt;/xslFileNames&gt;</span>
<span class="code-tag">&lt;/buildReportBuildPlugin&gt;</span></pre>
</div></div>


<p>On his <a href="http://blogs.blackmarble.co.uk/blogs/bm-bloggers/archive/2006/06/14/5255.aspx">blog</a>, Richard has included some more detailed instructions and tips for integrating CCNet and MSTest.</p>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>